import {  requestUserChannel, requestAllChannel } from "@/api";
const state={
    userChannel:[],
    allChannel:[],
}
const mutations={
    USERCHANNEL(state,data){
        state.userChannel=data
    },
    ALLCHANNEL(state,data){
        state.allChannel=data
    }
}
const actions={
    async userChannel({commit}){
        const res = await requestUserChannel();
        commit('USERCHANNEL',res.data.channels)
    },
    async allChannel({commit}){
        const res = await requestAllChannel();
        commit('ALLCHANNEL',res.data.channels)
    }

}
export default{
    state,
    mutations,
    actions
}
                                                               
